<% content_for :mid do %>
<div id="midnav_left"></div>
<div id="midnav_back">
<div id="notice">
<%= list_notice(flash[:notice]) %>
</div>
</br>
</br>
<div>
  <strong><%= link_to "讨论区",:controller=>"forum",:action=>"index" %></strong><span class="arrow">&rarr;</span>
  <strong><%= link_to h(@forum.name),:controller=>"forum",:action=>"read_forum",:id=>@forum.id%></strong>
</div>
</div>
<div id="midnav_right"></div>
<% end %>
<table width="650" border="0" align="center" cellpadding="0"
	cellspacing="0">
	<tr>
		<td align="right">
		<div id="cancel_topic" height="30"><%=image_tag "/images/down.gif" %>&nbsp;&nbsp;<a
			onclick="Effect.BlindDown('new_topic'); Element.hide('cancel_topic');return false;"
			href="#">在本区发表新话题</a></div>
		<div id="new_topic" style="DISPLAY:none">
		<%=image_tag "/images/up.gif" %>&nbsp;&nbsp;<a
			onclick="Element.show('cancel_topic'); Element.hide('new_topic');return false;"
			href="#">取消我发表的话题</a>
		<p><%= render :partial=>"create_topic",:locals => {:category => @category}%></p>
		</div>
		</td>
	</tr>
</table>
</br>
<table width="670" border="0" cellpadding="0" cellspacing="0"
	align="center">
	<tr height="20" class="bluetext">
		<td width="8">&nbsp;</td>
		<td width="315" align="center"><strong>主题</strong></td>
		<td width="60" align="center"><strong>回复</strong></td>
		<td width="100" align="center"><strong>作者</strong></td>
		<td width="60" align="center"><strong>阅读</strong></td>
		<td width="120" align="center"><strong>最后更新</strong></td>
	</tr>
	<tr>
		<td colspan="6"><div class="dot_dash"></div></td>
	</tr>
	<%odd_or_even = 0 
		for topic in @topics 
		odd_or_even = 1 - odd_or_even%>
	<tr height="30">
		<td class="ListLine<%= odd_or_even %>">&nbsp;</td>
		<td class="ListLine<%= odd_or_even %>" align="left"><%= link_to h(topic.title), :controller=>"forum", :action=>"read_topic", :id=>topic.id %></td>
		<td class="ListLine<%= odd_or_even %>" align="center"><%=topic.reply_times%></td>
		<td class="ListLine<%= odd_or_even %>" align="center"><%=show_user_tag(topic.user)%></td>
		<td class="ListLine<%= odd_or_even %>" align="center"><%=topic.view_times%></td>
		<td class="ListLine<%= odd_or_even %>" align="center"><%=topic.updated_at.strftime("%y年%m月%d日-%H:%M") %></td>
	</tr>
	<% end-%>
</table>
<div id="page_tag">
<%if @pages%>
<%unless @pages.page_count ==1%>
<h1>结果页码：</h1>
 <%= if @pages.current.previous
	           link_to("<<前一页", {:page => @pages.current.previous,:search=>@query})
	       else
	           "<<前一页"
	       end%><span style="margin:5px;"><%=pagination_links(@pages,{:params=>{:id=>@forum.id}})%></span><%= if @pages.current.next
	           link_to("后一页>>", {:page => @pages.current.next,:search=>@query}) 
	       else
	           "后一页>>"
	       end%>
<%end%>
<%end%>
</div>
